using System;
using Navigant.Infrastructure.Cases;
using Navigant.Infrastructure.DomainBase;
using Navigant.Model.Cases;

namespace Navigant.Model.PreservationNotices
{
	/// <summary>
	/// This represents a batch of Preservation Notices.  This is used 
	/// for keeping track of a preservation notice queue.
	/// </summary>
    public class PreservationNoticeBatch : CaseChildItem, IAggregateRoot
    {
        #region Private Fields

        private DateTime created;
		private int noticeId;
		private PreservationNoticeCriteria criteria;
		private string fromEmailAddress;
		private string extraCriteriaFieldName;
		private string extraCriteriaFieldValue;

        #endregion

        #region Constructors

        public PreservationNoticeBatch(int noticeId,
            PreservationNoticeCriteria criteria, ICase parentCase, 
			string fromEmailAddress) : this(0, DateTime.Now,
            noticeId, criteria, parentCase, fromEmailAddress, 
            string.Empty, string.Empty)
		{
		}

		public PreservationNoticeBatch(int noticeId, 
			string extraCriterionFieldName,
			string extraCriterionFieldValue,
            ICase parentCase, 
			string fromEmailAddress) : this(0, DateTime.Now,
            noticeId, PreservationNoticeCriteria.Undefined, parentCase, 
            fromEmailAddress, extraCriterionFieldName, extraCriterionFieldValue)
		{
        }

        public PreservationNoticeBatch(int id, DateTime created,
			int noticeId, PreservationNoticeCriteria criteria,
            ICase parentCase, string fromEmailAddress,
			string extraCriteriaFieldName,
			string extraCriteriaFieldValue) : base(id, parentCase)
		{
			this.created = created;
			this.noticeId = noticeId;
			this.criteria = criteria;
			this.extraCriteriaFieldName = extraCriteriaFieldName;
			this.extraCriteriaFieldValue = extraCriteriaFieldValue;
            this.fromEmailAddress = fromEmailAddress;
        }

        #endregion

        #region Properties

        public DateTime Created
		{
			get { return this.created; }
		}

		public int NoticeId
		{
			get { return this.noticeId; }
		}

		public PreservationNoticeCriteria Criteria
		{
			get { return this.criteria; }
		}

		public string FromEmailAddress
		{
			get { return this.fromEmailAddress; }
		}

		public string ExtraCriteriaName
		{
			get { return this.extraCriteriaFieldName; }
		}

		public string ExtraCriteriaValue
		{
			get { return this.extraCriteriaFieldValue; }
        }

        #endregion

        protected override void Validate()
        {
        }

        protected override BrokenRuleMessages GetBrokenRuleMessages()
        {
            return null;
        }

        protected override void LoadExtendedProperties()
        {
        }
    }
}
